/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.tencent.mavenproject1;

import org.apache.commons.mail.DefaultAuthenticator;
import org.apache.commons.mail.Email;
import org.apache.commons.mail.EmailException;
import org.apache.commons.mail.SimpleEmail;


/**
 *
 * @author janksenhu
 */
public class Test3 {
    public static void main(String[] args) throws Exception{
        Email email = new SimpleEmail();
        email.setHostName("smtp.163.com");
        email.setSmtpPort(25);
        email.setSSL(true);
        email.setAuthenticator(new DefaultAuthenticator("hujiangshui", "hjs312net"));
        email.setSSLOnConnect(true);
        email.setFrom("hujiangshui@163.com");
        email.setSubject("TestMail");
        email.setMsg("This is a test mail ... :-)");
        email.addTo("hujiangshui@163.com");
        email.send();
        
    }
}
